package com.turing.data.engine.utils;

import com.turing.common.util.Tools;
import com.turing.data.vo.out.review.DependParamsVO;
import com.turing.data.vo.out.review.TaskElementVO;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class ScriptsUtils {

    public static List<TaskElementVO.DrawResultVO > tryInitResult( DependParamsVO dependParams ){
        List<TaskElementVO.DrawResultVO > resultVOs = new ArrayList<>();
        Map<String, List<TaskElementVO.DrawResultVO>> relatedModelElements = dependParams.getRelatedModelElements();
        if(Tools.isNotEmpty(relatedModelElements)){
            if(relatedModelElements.size()==1){
                resultVOs = relatedModelElements.entrySet().iterator().next().getValue();
            }
        }
        return resultVOs;
    }


}
